# Licensed under the GNU General Public License, version 2.
# # See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
class Getting

   def initialize(variable)
@variable = variable


   end

   def getaacid

puts "Please give the aminoacid chain to analyze. Use the one character shortcut for all aminoacids.
For example if your aminoacid is Alanin so write A (not Ala). To see the aminoacids list just write *LIST*.
Don't forget if you write any characters except aminoacid charackters like 'B - @ # $' the programme will remove them all and analyze rest of the input. Be sure about your input before posting here."

aacidsequence = gets.chomp!

def listget
require "aacidshort2"

print "Please use the list above and then write your aminoacid list to get analyze.\nIf you write the polypeptide chain wrong, programme would give the wrong anlayze.\nAminoasit Chain: "

aacidsequence = gets.chomp!
aacidsequence = aacidsequence.upcase
aacidsequence = aacidsequence.gsub(/[^AGPVLIMFSTCNQKHRWDEY]/, "")

aacidsequence = aacidsequence.gsub("A", "Ala ").gsub("G", "Gly ").gsub("P", "Pro ").gsub("V", "Val ").gsub("L", "Leu ").gsub("I","Ile ").gsub("M",  "Met ").gsub("F",  "Phe ").gsub("S", "Ser ").gsub("T", "Thr ").gsub("C", "Cys ").gsub("N", "Asn ").gsub("Q", "Gln ").gsub("K", "Lys ").gsub("H", "His ").gsub("R", "Arg ").gsub("W", "Trp ").gsub("D", "Asp ").gsub("E", "Glu ").gsub("Y", "Tyr ")
end

	if aacidsequence == "*LIST*"

listget()

	else

aacidsequence = aacidsequence.upcase
aacidsequence = aacidsequence.gsub(/[^AGPVLIMFSTCNQKHRWDEY]/, "")

			if aacidsequence.length == 0
listget()
				if aacidsequence.length == 0
puts "GAME OVER! Try Again..."
exit
				end
			else

aacidsequence = aacidsequence.gsub("A", "Ala ").gsub("G", "Gly ").gsub("P", "Pro ").gsub("V", "Val ").gsub("L", "Leu ").gsub("I","Ile ").gsub("M",  "Met ").gsub("F",  "Phe ").gsub("S", "Ser ").gsub("T", "Thr ").gsub("C", "Cys ").gsub("N", "Asn ").gsub("Q", "Gln ").gsub("K", "Lys ").gsub("H", "His ").gsub("R", "Arg ").gsub("W", "Trp ").gsub("D", "Asp ").gsub("E", "Glu ").gsub("Y", "Tyr ")
			end
	end
 
   end


   def getenzyme

puts "Choose the enzyme below to cut your polypeptide.\n( Pepsin[1] , Trypsin[2] , Chymotrypsin[3] )\nFor example to cut with Trypsin and Chymotrypsin write 23 "
print "Cut with:"

cut_with = gets.chomp!
cut_with = cut_with.gsub(/[^1-3]/, "")

     if cut_with.to_s.length == 0
puts "Please don't use any characters except [1,2,3] "
puts "Choose the enzyme below to cut your polypeptide.\n( Pepsin[1] , Trypsin[2] , Chymotrypsin[3] )\nFor example to cut with Trypsin and Chymotrypsin write 23 ( The programme will remove all characters except '1,2,3'.) "
print "Cut with:"

cut_with = gets.chomp!
cut_with = cut_with.gsub(/[^0-3]/, "")

         if cut_with.to_s.length == 0
puts "GAME OVER! Try Again..."
exit
         else 
cut_with = cut_with.to_s.gsub("1","Pepsin ").gsub("2","Trypsin ").gsub("3","Chymotrypsin ").gsub("0","")
cut_with = cut_with.split(" ")
         end
     else
cut_with = cut_with.to_s.gsub("1","Pepsin ").gsub("2","Trypsin ").gsub("3","Chymotrypsin ").gsub("0","")
cut_with = cut_with.split(" ")
     end

     end  

end